// export default function (res) {
//     const { body } = res;

//     const reqBodySchema = JSON.parse(
//         '{"description":"教练时间表查询参数","type":"object","required":["endDate","startDate","trainerIds"],"properties":{"trainerIds":{"type":"array","description":"教练ID","items":{"type":"integer","description":"教练ID","format":"int64"}},"startDate":{"type":"string","description":"开始日期","format":"date"},"endDate":{"type":"string","description":"结束日期","format":"date"},"fillLesson":{"type":"boolean","description":"是否填充课程信息"}}}'
//     );

//     // 校验顶级必填参数
//     if (reqBodySchema.required && reqBodySchema.required.length > 0) {
//         for (const requiredField of reqBodySchema.required) {
//             if (!body || !Object.prototype.hasOwnProperty.call(body, requiredField)) {
//                 return new Promise((resolve) => {
//                     resolve({
//                         code: 1,
//                         message: `缺少必填参数：${requiredField}`,
//                     });
//                 });
//             }
//         }
//     }

//     // Basic date validation (optional, but good practice)
//     const startDate = new Date(body.startDate);
//     const endDate = new Date(body.endDate);
//     if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
//         return new Promise((resolve) => {
//             resolve({
//                 code: 1,
//                 message: 'startDate或endDate格式无效',
//             });
//         });
//     }

//     return new Promise((resolve) => {
//         setTimeout(() => {
//             const trainerScheduleTimes = body.trainerIds.map(trainerId => {
//                 const hasScheduleTime = Math.random() < 0.8; // 80%的教练设置了排课时间
//                 const availableClasstime = parseFloat((Math.random() * 10).toFixed(1)); // 0.0到10.0之间

//                 const timeIntervals = [];
//                 if (hasScheduleTime) {
//                     // Generate time intervals between startDate and endDate
//                     let currentDate = new Date(startDate);
//                     while (currentDate <= endDate) {
//                         const numIntervals = Math.floor(Math.random() * 4); // 0-3 intervals per day
//                         for (let i = 0; i < numIntervals; i++) {
//                             const startHour = Math.floor(Math.random() * 24);
//                             const startMinute = Math.floor(Math.random() * 60);
//                             const intervalStartTime = new Date(currentDate);
//                             intervalStartTime.setHours(startHour, startMinute, 0, 0);

//                             const durationHours = Math.random() * 2 + 0.5; // 0.5 to 2.5 hours
//                             const intervalEndTime = new Date(intervalStartTime.getTime() + durationHours * 60 * 60 * 1000);

//                             const status = [1, 2, 3][Math.floor(Math.random() * 3)]; // 1:可约;2:休息;3:已约

//                             let lesson = null;
//                             if (body.fillLesson && status === 3) { // Only fill lesson info if status is '已约' (booked) and fillLesson is true
//                                 lesson = {
//                                     lessonId: Math.floor(Math.random() * 100000),
//                                     type: [1, 2, 3][Math.floor(Math.random() * 3)], // 1:体验课;2:陪练课;3:复习课
//                                     status: [1, 2, 3, 4][Math.floor(Math.random() * 4)], // 1:待上课;2:上课中;3:已下课;4:已取消
//                                     student: {
//                                         id: Math.floor(Math.random() * 10000),
//                                         name: `学员${Math.floor(Math.random() * 100)}`,
//                                         sn: `SN${Math.floor(Math.random() * 10000).toString().padStart(4, '0')}`,
//                                         grade: ["一年级", "二年级", "三年级", "四年级", "五年级", "六年级", "初一", "初二", "初三", "初四", "高一", "高二", "高三", "大一", "大二", "大三", "大四", "大四以上"][Math.floor(Math.random() * 19)],
//                                         school: `学校${Math.floor(Math.random() * 5)}`,
//                                         trainAccount: Math.random() < 0.5,
//                                     },
//                                 };
//                             }

//                             timeIntervals.push({
//                                 startTime: intervalStartTime.toISOString(),
//                                 endTime: intervalEndTime.toISOString(),
//                                 status: status,
//                                 lesson: lesson,
//                             });
//                         }
//                         currentDate.setDate(currentDate.getDate() + 1); // Move to the next day
//                     }
//                 }

//                 return {
//                     id: trainerId,
//                     name: `教练${trainerId}`,
//                     deliveryGroup: {
//                         id: Math.floor(Math.random() * 1000),
//                         name: `交付组织${Math.floor(Math.random() * 10)}`,
//                         fullName: `全称交付组织${Math.floor(Math.random() * 10)}`,
//                         code: `ORG${Math.floor(Math.random() * 100).toString().padStart(3, '0')}`,
//                         orgLevel: [10, 20, 30, 40][Math.floor(Math.random() * 4)],
//                     },
//                     scheduleTimeCreated: hasScheduleTime,
//                     availableClasstime: availableClasstime,
//                     timeIntervals: timeIntervals,
//                 };
//             });

//             resolve({
//                 code: 0,
//                 message: 'success',
//                 data: trainerScheduleTimes,
//                 timestamp: Date.now(),
//                 signature: 'signature' + Math.floor(Math.random() * 1000),
//                 requestId: 'requestId' + Math.floor(Math.random() * 1000),
//             });
//         }, 100);
//     });
// }


export default function (res) {
    return {
        "code": 0,
        "message": "请求成功",
        "data": [
            {
                "id": 2,
                "name": "轻秋-安知之",
                "deliveryGroup": {
                    "id": 10008,
                    "name": "NewOrleans二组",
                    "fullName": "交付中心-美国S-新奥尔良二部-NewOrleans二组",
                    "code": "JF12026",
                    "orgLevel": 40
                },
                "scheduleTimeCreated": true,
                "availableClasstime": 164.83,
                "timeIntervals": [
                    {
                        "startTime": "2025-09-25 00:00:00",
                        "endTime": "2025-09-25 12:00:00",
                        "status": 1,
                        "lesson": null
                    },
                    {
                        "startTime": "2025-09-25 12:00:00",
                        "endTime": "2025-09-25 12:10:00",
                        "status": 3,
                        "lesson": {
                            "lessonId": 220,
                            "type": 3,
                            "status": 3,
                            "scheduledStartTime": "2025-09-25 12:00:00",
                            "scheduledEndTime": "2025-09-25 12:10:00",
                            "student": {
                                "id": 295,
                                "name": "复习",
                                "sn": "186937298815166",
                                "grade": "初二",
                                "school": "",
                                "trainAccount": false
                            }
                        }
                    },
                    {
                        "startTime": "2025-09-25 12:00:00",
                        "endTime": "2025-09-25 12:10:00",
                        "status": 3,
                        "lesson": {
                            "lessonId": 221,
                            "type": 4,
                            "status": 3,
                            "scheduledStartTime": "2025-09-25 12:00:00",
                            "scheduledEndTime": "2025-09-25 12:10:00",
                            "student": {
                                "id": 295,
                                "name": "抗遗忘复习",
                                "sn": "186937298815166",
                                "grade": "初二",
                                "school": "",
                                "trainAccount": false
                            }
                        }
                    },
                    {
                        "startTime": "2025-09-25 12:00:00",
                        "endTime": "2025-09-25 12:10:00",
                        "status": 3,
                        "lesson": {
                            "lessonId": 222,
                            "type": 4,
                            "status": 3,
                            "scheduledStartTime": "2025-09-25 12:00:00",
                            "scheduledEndTime": "2025-09-25 12:10:00",
                            "student": {
                                "id": 295,
                                "name": "试试",
                                "sn": "186937298815166",
                                "grade": "初二",
                                "school": "",
                                "trainAccount": false
                            }
                        }
                    },
                    {
                        "startTime": "2025-09-25 12:10:00",
                        "endTime": "2025-09-26 00:00:00",
                        "status": 1,
                        "lesson": null
                    },
                    {
                        "startTime": "2025-09-26 00:00:00",
                        "endTime": "2025-09-27 00:00:00",
                        "status": 1,
                        "lesson": null
                    },
                    {
                        "startTime": "2025-09-27 00:00:00",
                        "endTime": "2025-09-28 00:00:00",
                        "status": 1,
                        "lesson": null
                    },
                    {
                        "startTime": "2025-09-28 00:00:00",
                        "endTime": "2025-09-28 13:00:00",
                        "status": 1,
                        "lesson": null
                    },
                    {
                        "startTime": "2025-09-28 13:00:00",
                        "endTime": "2025-09-28 15:00:00",
                        "status": 3,
                        "lesson": {
                            "lessonId": 250,
                            "type": 2,
                            "status": 3,
                            "scheduledStartTime": "2025-09-28 13:00:00",
                            "scheduledEndTime": "2025-09-28 15:00:00",
                            "student": {
                                "id": 329,
                                "name": "史诗",
                                "sn": "171634504680368",
                                "grade": "初三",
                                "school": "学校",
                                "trainAccount": false
                            }
                        }
                    },
                    {
                        "startTime": "2025-09-28 15:00:00",
                        "endTime": "2025-09-29 00:00:00",
                        "status": 1,
                        "lesson": null
                    },
                    {
                        "startTime": "2025-09-29 00:00:00",
                        "endTime": "2025-09-29 09:00:00",
                        "status": 1,
                        "lesson": null
                    },
                    {
                        "startTime": "2025-09-29 09:00:00",
                        "endTime": "2025-09-29 10:00:00",
                        "status": 3,
                        "lesson": {
                            "lessonId": 275,
                            "type": 2,
                            "status": 3,
                            "scheduledStartTime": "2025-09-29 09:00:00",
                            "scheduledEndTime": "2025-09-29 10:00:00",
                            "student": {
                                "id": 204,
                                "name": "萧亚轩",
                                "sn": "349919383555401",
                                "grade": "初二",
                                "school": "",
                                "trainAccount": false
                            }
                        }
                    },
                    {
                        "startTime": "2025-09-29 10:00:00",
                        "endTime": "2025-09-30 00:00:00",
                        "status": 1,
                        "lesson": null
                    },
                    {
                        "startTime": "2025-09-30 00:00:00",
                        "endTime": "2025-09-31 00:00:00",
                        "status": 1,
                        "lesson": null
                    },
                    {
                        "startTime": "2025-09-31 00:00:00",
                        "endTime": "2025-09-01 00:00:00",
                        "status": 1,
                        "lesson": null
                    }
                ],
                "latestEndTime": "2026-07-31 00:00:00",
                "teachCount": null,
                "trainerType": null,
                "lessonIds": [
                    220,
                    250,
                    275
                ]
            },
            {
                "id": 3,
                "name": "轻秋-安安3",
                "deliveryGroup": {
                    "id": 10004,
                    "name": "Atlanta一组",
                    "fullName": "交付中心-美国S-亚特兰大一部-Atlanta一组",
                    "code": "JF16018",
                    "orgLevel": 40
                },
                "scheduleTimeCreated": true,
                "availableClasstime": 168.00,
                "timeIntervals": [
                    {
                        "startTime": "2025-09-25 00:00:00",
                        "endTime": "2025-09-26 00:00:00",
                        "status": 1,
                        "lesson": null
                    },
                    {
                        "startTime": "2025-09-26 00:00:00",
                        "endTime": "2025-09-27 00:00:00",
                        "status": 1,
                        "lesson": null
                    },
                    {
                        "startTime": "2025-09-27 00:00:00",
                        "endTime": "2025-09-28 00:00:00",
                        "status": 1,
                        "lesson": null
                    },
                    {
                        "startTime": "2025-09-28 00:00:00",
                        "endTime": "2025-09-29 00:00:00",
                        "status": 1,
                        "lesson": null
                    },
                    {
                        "startTime": "2025-09-29 00:00:00",
                        "endTime": "2025-09-30 00:00:00",
                        "status": 1,
                        "lesson": null
                    },
                    {
                        "startTime": "2025-09-30 00:00:00",
                        "endTime": "2025-09-31 00:00:00",
                        "status": 1,
                        "lesson": null
                    },
                    {
                        "startTime": "2025-09-31 00:00:00",
                        "endTime": "2025-09-01 00:00:00",
                        "status": 1,
                        "lesson": null
                    }
                ],
                "latestEndTime": "2026-08-01 00:00:00",
                "teachCount": null,
                "trainerType": null,
                "lessonIds": []
            }
        ],
        "timestamp": 1759031244317,
        "requestId": "EEF05F1D-D67A-4684-9483-21741B11ED25"
    }
}